<%@ page language="java" pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="ww" uri="webwork" %>
<ww:bean name="'com.css.msgcenter.admin.msglog.service.MsgLogService'" id="msgLogService" />
<form class="form-horizontal table-form" name="form1" id="form1" method="post" action="dirLogStatis.action" style="min-height: initial;"  
	onsubmit="return logStatisSearch(this)">
	<input type="hidden" name="page.orderFlag" class="order-flag" value="<ww:property value='page.orderFlag'/>"> 
	<input type="hidden" name="page.orderString" class="order-string" value="<ww:property value='page.orderString'/>">
	<div class="table-header">
		<div class="table-search">
			<ul>
			    <li><input class="input-small Wdate" id="msglog4311" name="beginTime" readonly="true" type="text" onclick="WdatePicker({maxDate:'#F{$dp.$D(\'msglog4312\')}'})" value='<ww:property value="new java.text.SimpleDateFormat('yyyy-MM-dd').format(beginTime)"/>'> 
			    至 <input class="input-small Wdate" id="msglog4312" name="endTime" readonly="true" type="text" onclick="WdatePicker({minDate:'#F{$dp.$D(\'msglog4311\')}'})" value='<ww:property value="new java.text.SimpleDateFormat('yyyy-MM-dd').format(endTime)"/>'></li>
				<li>第三方应用：<ww:select attributes="class='input-medium'" name="'openFlag'" id="openFlag" value="openFlag" list="#msgLogService.getSelect4App()" listKey="uuid" listValue="appName"></ww:select> </li>
			    <li><ww:button css="btn green" caption="查询" funcode="msgcenter_msglog/dirLogStatis"  onclick="$(this).submit();"></ww:button></li>
			</ul>
		</div>
		<div class="table-btn">
		</div>
	</div>
	<table class="table table-bordered">
		<thead>
			<tr>
				<th width="20%">第三方应用</th>
				<th width="20%" order-field="suc" class="order">成功</th>
				<th width="20%" order-field="fail" class="order">失败</th>
				<th width="20%" order-field="al" class="order">总计</th>
			</tr>
		</thead>
		<tbody>
			<ww:set name="bt" value="new java.text.SimpleDateFormat('yyyy-MM-dd').format(beginTime)"/>
			<ww:set name="et" value="new java.text.SimpleDateFormat('yyyy-MM-dd').format(endTime)"/>
		  <ww:iterator value="rlst" id="data" status="data">
			<tr>
				<ww:set name="obj" value="rlst[#data.index]"/>
                <td class="text-center"><ww:link funcode="msgcenter_msglog/dirLogStatis2" target="cssTab"  rel="dirLogStatis2%{#obj[0]}" 
                	caption="%{#msgLogService.getAppName(#obj[0])}" title="%{#msgLogService.getAppName(#obj[0])}" 
                	href="dirLogStatis2.action?appId=%{#obj[0]}&beginTime=%{#bt}&endTime=%{#et}" ></ww:link></td>
                <td class="text-center"><a href='dirMsgTask.action?appId=<ww:property value="#obj[0]"/>&msgStatus=3&beginTime=<ww:property value="#bt"/>&endTime=<ww:property value="#et"/>' 
                		rel="RWJK" target="cssTab" title="任务监控" refresh="true"><ww:property value="#obj[1]"/></a></td>
                <td class="text-center"><a href='dirMsgTask.action?appId=<ww:property value="#obj[0]"/>&msgStatus=4&beginTime=<ww:property value="#bt"/>&endTime=<ww:property value="#et"/>' 
                		rel="RWJK" target="cssTab" title="任务监控" refresh="true"><ww:property value="#obj[2]"/></a></td>
                <td class="text-center"><a href='dirMsgTask.action?appId=<ww:property value="#obj[0]"/>&beginTime=<ww:property value="#bt"/>&endTime=<ww:property value="#et"/>' 
                		rel="RWJK" target="cssTab" title="任务监控" refresh="true"><ww:property value="#obj[3]"/></a></td>
			</tr>
			</ww:iterator>
			<tr>
                <td class="text-center">总计</td>
                <td class="text-center"><a href='dirMsgTask.action?msgStatus=3&beginTime=<ww:property value="#bt"/>&endTime=<ww:property value="#et"/>' 
                		rel="RWJK" target="cssTab" title="任务监控" refresh="true"><ww:property value="suc"/></a></td>
                <td class="text-center"><a href='dirMsgTask.action?msgStatus=4&beginTime=<ww:property value="#bt"/>&endTime=<ww:property value="#et"/>' 
                		rel="RWJK" target="cssTab" title="任务监控" refresh="true"><ww:property value="fail"/></a></td>
                <td class="text-center"><a href='dirMsgTask.action?beginTime=<ww:property value="#bt"/>&endTime=<ww:property value="#et"/>' 
                		rel="RWJK" target="cssTab" title="任务监控" refresh="true"><ww:property value="al"/></a></td>
			</tr>
		</tbody>
	</table>
</form>
<form id="form2" name="form2" target="logStatisFrame" action="dirLogStatis.action?result=chart" method="post">
    <input type="hidden" name="et" value="<ww:property value="#et"/>">
    <input type="hidden" name="a0" value="<ww:property value="a0"/>">
    <input type="hidden" name="a1" value="<ww:property value="a1"/>">
    <input type="hidden" name="a2" value="<ww:property value="a2"/>">
    <input type="hidden" name="b0" value="<ww:property value="b0"/>">
    <input type="hidden" name="b1" value="<ww:property value="b1"/>">
    <input type="hidden" name="c0" value="<ww:property value="c0"/>">
    <input type="hidden" name="c1" value="<ww:property value="c1"/>">
    <input type="hidden" name="c2" value="<ww:property value="c2"/>">
    <input type="hidden" name="cm" value="<ww:property value="cm"/>">
</form>
<iframe id="logStatisFrame" name="logStatisFrame" frameborder="no" border="0" framespacing="0" scrolling="no" style="width:100%;height:1260px;"></iframe>
<script>
var $tab = $.cssTab.focus();
$("#form2", $tab).submit();
function logStatisSearch(t) {
	var pars = "check=true&" + $(t).serialize();
	$.post('dirLogStatis.action',pars,function(data){
		if(data.result == 1) {
			return navTabSearch(t);
		} else{
			$css.alert(data.msg);
			return false;
		}
	},'json');
}
</script>


